Trustworthy Proxies - Virtualizing Objects with Invariants
نویسندگان
چکیده
Proxies are a common technique to virtualize objects in object-oriented languages. A proxy is a placeholder object that emulates or wraps another target object. Both the proxy’s representation and behavior may differ substantially from that of its target object. In many OO languages, objects may have language-enforced invariants associated with them. For instance, an object may declare immutable fields, which are guaranteed to point to the same value throughout the execution of the program. Clients of an object can blindly rely on these invariants, as they are enforced by the language. In a language with both proxies and objects with invariants, these features interact. Can a proxy emulate or replace a target object purporting to uphold such invariants? If yes, does the client of the proxy need to trust the proxy to uphold these invariants, or are they still enforced by the language? This paper sheds light on these questions in the context of a Javascript-like language, and describes the design of a Proxy API that allows proxies to emulate objects with invariants, yet have these invariants continue to be language-enforced. This design forms the basis of proxies in ECMAScript 6.
منابع مشابه
Transparent object proxies for javascript
Proxies are the swiss army knives of object adaptation. They introduce a level of indirection to intercept select operations on a target object and divert them as method calls to a handler. Proxies have many uses like implementing access control, enforcing contracts, virtualizing resources. One important question in the design of a proxy API is whether a proxy object should inherit the identity...
متن کاملTransparent Object Proxies for JavaScript Technical Report
Proxies are the swiss army knives of object adaptation. They introduce a level of indirection to intercept select operations on a target object and divert them as method calls to a handler. Proxies have many uses like implementing access control, enforcing contracts, virtualizing resources. One important question in the design of a proxy API is whether a proxy object should inherit the identity...
متن کاملReusability, open implementation and Java's dynamic proxies
In this paper we investigate the implications of Java’s dynamic proxies for supporting open architectures to implement reusable code. Dynamic proxies are interpreted as meta-objects, which define the behaviour of other objects and allow the implementation of meta-objects protocols.
متن کاملVirtualizing Real-World Objects in FRP
We begin with a functional reactive programming (FRP) model in which every program is viewed as a signal function that converts a stream of input values into a stream of output values. We observe that objects in the real world – such as a keyboard or sound card – can be thought of as signal functions as well. This leads us to a radically different approach to I/O – instead of treating real-worl...
متن کاملThree-Dimensional Object Modeling - Towards Improving Access to Collections by Virtualizing Reality
The paper describes the recent evolution of a laser scanning technology which is used to digitize objects in three-dimensions with colour.Data sets are turned into computerized models that can be manipulated, displayed, measured, and compared, and which can be shared on networked systems. The technology should improve the electronic access to museum collections.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013